<?php

$level_pengguna = $_SESSION['id_jenis_pengguna'];
?>
<script type="text/javascript" src="module/mod_klaim/js/klaim.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#minimize").click(function(){
			$("#formulir_klaim").toggle(500);
			
		});
	});
</script>
<div id=tiga_ba>
	<div id=tiga_baa>Tambah Klaim</div>
	<div id=tiga_bab></div>
	<div class=clear></div>
</div>
<table style="margin: 10px 15px 10px 15px;">
  <tr>
    <td>Total Semua </td>
    <td><div style="font-weight:bold;" id="target_total_semua"></div></td>
  </tr>
  <tr>
    <td>Ditanggung Semua </td>
    <td><div style="font-weight:bold;" id="target_ditanggung_semua"></div></td>
  </tr>
  <tr>
    <td>Selisih Semua </td>
    <td><div style="font-weight:bold;" id="target_selisih_semua"></div></td>
  </tr>

</table>
<form id="form_klaim" name="form_klaim" action="utama.php?module=mod_klaim&act=simpan" onsubmit="return gsValidate('no_klaim','Nomer Klaim Harus Diisi','required');" method="post" enctype="multipart/form-data">
	<div id="formulir_klaim">
	<table style="margin: 10px 15px 10px 15px;">
	<?php
	$no_klaim=kode_klaim();
	?>
		<tr>
			<td width="200">Nomer Klaim</td>
			<td>&nbsp;</td>
			<td width="320"><input name="no_klaim" type="text" readonly value="<?php echo $no_klaim;?>" class="input2" id="no_klaim" maxlength="50"/></td>
			<td width="200">Jenis Layanan</td>
			<td>&nbsp;</td>
			<td><?php buat_kombo_baru("jenis_layanan","jenis_layanan","input_field","id_jenis_layanan","jenis_layanan")?></td>
		</tr>
		<tr>
			<td>Tanggal Klaim </td>
			<td>&nbsp;</td>
			<td><input value="<?php echo date('Y-m-d');?>" name="tgl_klaim" type="text" class="input2" id="tgl_klaim" maxlength="50" onChange="selisih_hari()"/></td>
			<td>Dokter</td>
			<td>&nbsp;</td>
			<td><input  name="dokter" type="text" class="input2" id="dokter" maxlength="50"/></td>
		</tr>
		<tr>
			<td>Tanggal Masuk </td>
			<td>&nbsp;</td>
			<td><input value="<?php echo date('Y-m-d');?>" name="tgl_masuk" type="text" class="input2" id="tgl_masuk" maxlength="50" onChange="selisih_hari()"/></td>
			<td>Nama PPK</td>
			<td>&nbsp;</td>
			<td>
			<?php
			if($level_pengguna !='7'){
			?>
			<?php buat_kombo_baru("ppk","nama_ppk","input_field","id_ppk","nama")?>
			<?php
			}else{
			$detail_ppk=get_detail_ppk_userlogin($_SESSION['id_pengguna']);
			
			?>
			
			<input type="hidden" name="nama_ppk" id="nama_ppk" value="<?php echo $detail_ppk['id_ppk']; ?>" />
			<?php echo $detail_ppk['nama_ppk']; ?>
			<?php
			}
			?>
			</td>
		</tr>
		<tr>
			<td>Tanggal Keluar </td>
			<td>&nbsp;</td>
			<td><input value="<?php echo date('Y-m-d');?>" name="tgl_keluar" type="text" class="input2" id="tgl_keluar" maxlength="50" onChange="selisih_hari()"/></td>
			<td>Umur</td>
			<td>&nbsp;</td>
			<td><div id="target_umur"></div>
			<input name="umur_pasien" readonly="" type="hidden"id="umur_pasien" /></td>
		</tr>
		<tr>
			<td>Nomer Jaminan </td>
			<td>&nbsp;</td>
		  <td><input name="id_jaminan" onchange="isi_jaminan('id_jaminan');" type="text" class="input2" id="id_jaminan"  maxlength="50"/>
		    <!--<a href="javascript:void(0)" title="Tambah" onclick="cariPeserta()"><img src="asset/images/button-add.gif" alt="Tambah" border=0 /></a>	-->		</td>
			<td>Lama Rawat</td>
			<td>&nbsp;</td>
			<td><input readonly="" name="lama_rawat" type="text" class="input2" id="lama_rawat" maxlength="50"/></td>
		</tr>
		<tr>
			<td>No Peserta </td>
			<td>&nbsp;</td>
			<td><input name="no_peserta" type="text" class="input2" readonly="" id="no_peserta" maxlength="50"/></td>
			<td>No. RM</td>
			<td>&nbsp;</td>
			<td><input name="no_rm" type="text" class="input2" id="no_rm" maxlength="50"/></td>
		</tr>
		<tr>
			<td>Nama Peserta </td>
			<td>&nbsp;</td>
			<td><input name="nama_peserta" type="text" readonly="" class="input2" id="nama_peserta" maxlength="50"/></td>
			
			<?php
			
			if($level_pengguna !='7' && $level_pengguna !='5'){
			?>
			<td>Verifikator</td>
			<td>&nbsp;</td>
			<td><?php 
			$sql_verifikator="SELECT * FROM pengguna where id_jenis_pengguna=5 and id_pengguna !=16";
			$qry_verifikator=mysql_query($sql_verifikator);
			while($hasil_verifikator=mysql_fetch_array($qry_verifikator)){
				$arr_verifikator[$hasil_verifikator['id_pengguna']]=$hasil_verifikator['nama'];
			}
			kombo_from_array("verifikator","input_field",$arr_verifikator);
			//buat_kombo_baru("verifikator","verifikator","input_field","id_verifikator","nama_verifikator")
			//buat_kombo_baru("verifikator","verifikator","input_field","id_verifikator","nama_verifikator")?></td>
			<?php
			}else if($level_pengguna =='5'){
			?>
			<td>Verifikator</td>
			<td>&nbsp;</td>
			<td> <input type="hidden" name="verifikator" id="verifikator" value="<?php echo $_SESSION['id_pengguna']; ?>" />
			<?php echo $_SESSION['nama']; ?>
			<td>
			<?php
			}
			?>
		</tr>
		<tr>
			<td rowspan="2">Keterangan</td>
			<td rowspan="2">&nbsp;</td>
			<td rowspan="2"><textarea name="keterangan" class="input2" id="keterangan" rows="3"/></textarea></td>
			<td>Status Keluar</td>
			<td>&nbsp;</td>
			<td><?php buat_kombo_baru("status_keluar","status_keluar","input_field","id_status_keluar","status_keluar")?></td>
		</tr>
		
	</table>
	</div>
	<div style="text-align: center;"><img src="asset/images/minimize.png" id="minimize"></div>
<div id="menu_klaim">
	<ul>
		<li id="btnDiagnosis">Diagnosis</li>
		<li id="btnProsedur">Prosedur</li>
		<li id="btnLayanan">Layanan</li>
		<li id="btnTindakan">Tindakan</li>
		<li id="btnLab">Laboratorium</li>
		<li id="btnRadiologi">Radiologi</li>
		<li id="btnElektromedik">Elektromedik</li>
		<li id="btnRehabilitasi">Rehabilitasi</li>
		<li id="btnObat">Obat</li>
		<li id="btnAbhp">ABHP</li>
		
	</ul>
</div>
<div id="paket" class="hidden">
	<table style="margin: 10px 15px 10px 15px;">
		<tr>
			<td width="200">Nomer Klaim</td>
			<td>&nbsp;</td>
			<td width="320"><input name="nomer" type="text" class="input2" id="nomer" maxlength="50"/></td>
			<td width="200">Jenis Layanan</td>
			<td>&nbsp;</td>
			<td><input name="nama" type="text" class="input2" id="nama" maxlength="50"/></td>
		</tr>
	</table>
</div>
<div id="layanan" class="hidden"><?php require_once 'module/mod_klaim/js/layanan.php';?></div>
<div id="prosedur" class="hidden"><?php require_once 'module/mod_klaim/js/prosedur.php';?></div>
<div id="obat" class="hidden"><?php require_once 'module/mod_klaim/js/obat.php';?></div>
<div id="abhp" class="hidden"><?php require_once 'module/mod_klaim/js/abhp.php';?></div>
<div id="tindakan" class="hidden"><?php require_once 'module/mod_klaim/js/tindakan.php';?></div>
<div id="diagnosis" class="hidden"><?php require_once 'module/mod_klaim/js/diagnosis.php';?></div>	
<div id="laboratorium" class="hidden"><?php require_once 'module/mod_klaim/js/laboratorium.php';?></div>
<div id="elektromedik" class="hidden"><?php require_once 'module/mod_klaim/js/elektromedik.php';?></div>
<div id="rehabilitasi" class="hidden"><?php require_once 'module/mod_klaim/js/rehabilitasi.php';?></div>
<div id="radiologi" class="hidden"><?php require_once 'module/mod_klaim/js/radiologi.php';?></div>
<br />
<table width="30%" border="0" cellspacing="0" cellpadding="0">

  <tr>
    <td>&nbsp;</td>
    <td><input name="simpan" type="submit" class="button" id="simpan" value="Simpan" /></td>
  </tr>
</table>
</form>
<script type="text/javascript">
function cek_enter(e){

var kode = e.keyCode;
//alert(kode);
 if(kode == 13){
 if (e.preventDefault) e.preventDefault();
 e.cancelBubble = true; 	
 e.returnValue = false; 
 return false;
 }
 return true;
}
var input=document.getElementsByTagName('input');
n=input.length;
if(n>1){
for(var i=0;i<n;i++){
	input[i].onkeypress = function(e){return cek_enter(e);};
}
}else{
	input.onkeypress = function(e){return cek_enter(e);};
}

</script>